home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilsf / jfshared / Modules / SpacedFile / Source`v1, < prev   
Encoding:
Text File  |  1995-08-10  |  1.6 KB  |  79 lines

  1. APP  SpacedFiles
  2. IN   -
  3. OUT  SpcFiles
  4. Type Module
  5.  
  6. DEFINE MODULE
  7.  Name    SpacedFiles
  8.  Help    Spaced filenames
  9.  Version 1.00
  10.  Author  Justin Fletcher
  11.  Commands
  12.   Name   SpacedFiles
  13.   Help   ...
  14.     The SpacedFiles module allows you to create files with spaces in their
  15.     names and to have them automatically formatted into Alt-Spaces.
  16.  End Commands
  17.  PostFilter
  18.   Name   Spaced Filenames
  19.   Task   -
  20.   Code   filtercode
  21.   Accept Message
  22.   Accept MessageRec
  23.  End Filter
  24. END MODULE
  25.  
  26. PRE
  27. # REM OFF
  28. # COND INLINE
  29. # COND underline Do you want to change underlines to spaces
  30. END PRE
  31.  
  32. .eventtype
  33.    EQUD   0
  34.  
  35. .filtercode
  36.    STMFD  (sp)!,{r1-r2,link}
  37.    CMP    r0,#17
  38.    CMPNE  r0,#18
  39.    BEQ    isourevent
  40.    LDMFD  (sp)!,{r1-r2,pc}
  41.  
  42. .isourevent
  43. ;   SWI    &104
  44.    REM    "Filter %r0"
  45.    STR    r0,eventtype
  46.    LDR    r2,[r1,#16]
  47.    CMP    r2,#1
  48.    BEQ    isDataSave
  49. .exitevent
  50.    LDR    r0,eventtype
  51.    LDMFD  (sp)!,{r1-r2,pc}
  52.  
  53. .isDataSave
  54. ; check the filename
  55.    ADD    r2,r1,#44       ; filename
  56.    REM    "Check icon, pointer = %&2"
  57. ._iDS_loop
  58.    LDRB   r0,[r2]         ; read byte of filename
  59.    ADD    r2,r2,#1
  60. # COND OF underline
  61.    CMP    r0,#ASC("_")    ; is it a _ ?
  62.    MOVEQ  r0,#160         ; change to space
  63. # COND END
  64.    CMP    r0,#32          ; is it space
  65.    MOVEQ  r0,#160         ; if so, use a hard-space
  66.    STRB   r0,[r2,#-1]     ; store back
  67.    BGE    _iDS_loop
  68.    LDR    r0,eventtype
  69.    LDMFD  (sp)!,{r1-r2,pc}
  70.  
  71.    EQUS   "Check out Final Conflict's albumn “Quest” - it's really "
  72.    EQUS   "excellent prog-rock. Also, try Grey Lady Down “The Crime”, "
  73.    EQUS   "or Jadis “More That Meets The Eye”."
  74.    EQUB   0
  75.  
  76. #POST
  77. #RUN <CODE>
  78. # END
  79.